import moment from 'moment'
import store from '@/store'

export function transformTimeZone (date, format) {
  return moment.tz(date, store.state.user.timezoneId).format(format || 'MM/DD/YYYY HH:mm z')
}

export function transformTimeZoneLocal (date, format) {
  return moment.tz(date, moment.tz.guess()).format(format || 'MM/DD/YYYY HH:mm z')
}

export function formatDate (date, format) {
  return moment(date).format(format || 'MM/DD/YYYY')
}